package com.it.zhangjun.config;

import org.apache.commons.configuration.AbstractConfiguration;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Properties;

/**
 * 默认配置
 *
 * @author: z00018123
 * @date: 2021/5/10
 **/
@Configuration
public class DefaultConfig implements Config {

    static volatile AbstractConfiguration instance = null;

    public DefaultConfig() {
        Properties properties = new Properties();
        InputStream in = DefaultConfig.class.getClassLoader().getResourceAsStream("config/config.properties");
        try {
            properties.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
        for (Map.Entry<Object, Object> entry: properties.entrySet()) {
            //instance.setProperty((String) entry.getKey(), entry.getValue());
        }
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public Integer getAge() {
        return null;
    }
}
